www.gusucode.com > VC++网络版的打字软件源程序-源码程序 > VC++网络版的打字软件源程序-源码程序\code\TypeClt V2.0\LoginDlg.cpp

    // LoginDlg.cpp : implementation file
// Download by http://www.NewXing.com

#include "stdafx.h"
#include "Type.h"
#include "LoginDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLoginDlg dialog


CLoginDlg::CLoginDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CLoginDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLoginDlg)
	m_strHostName = _T("dyzxDoc");
	m_strID = _T("");
	m_strName = _T("");
	//}}AFX_DATA_INIT
}


void CLoginDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLoginDlg)
	DDX_Text(pDX, IDC_HOST_NAME, m_strHostName);
	DDV_MaxChars(pDX, m_strHostName, 20);
	DDX_Text(pDX, IDC_ID, m_strID);
	DDV_MaxChars(pDX, m_strID, 4);
	DDX_Text(pDX, IDC_NAME, m_strName);
	DDV_MaxChars(pDX, m_strName, 8);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLoginDlg, CDialog)
	//{{AFX_MSG_MAP(CLoginDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLoginDlg message handlers

void CLoginDlg::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	if(m_strHostName.IsEmpty())
	{
		MessageBox("您还没有输入服务器地址!","提示窗口");
		return;
	}
	if(m_strID.IsEmpty())
	{
		MessageBox("您还没有输入学号!","提示窗口");
		return;
	}
	if(m_strName.IsEmpty())
	{
		MessageBox("您还没有输入姓名!","提示窗口");
		return;
	}

	CDialog::OnOK();
}